package com.zhijian.medical.dao.local;


import com.zhijian.medical.entity.po.ExperimentReport;
import com.zhijian.medical.entity.vo.request.ExperimentReportSearchVo;
import com.zhijian.medical.entity.vo.response.ExperimentReportListVo;
import com.zhijian.medical.entity.vo.response.ExperimentReportVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ExperimentReportMapper {
    int deleteByPrimaryKey(Long id);

    /**
     * 根据类型与实验流程id进行删除
     *
     * @param type
     * @param experimentProcessId
     * @return
     */
    int deleteByTypeAndExperimentProcessId(@Param("type") Byte type, @Param("experimentProcessId") Long experimentProcessId);

    int insert(ExperimentReport record);

    int insertSelective(ExperimentReport record);

    ExperimentReport selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ExperimentReport record);

    int updateByPrimaryKey(ExperimentReport record);

    int count(ExperimentReportSearchVo experimentReportSearchVo);

    List<ExperimentReportVo> selectList(ExperimentReportSearchVo experimentReportSearchVo);

    /**
     * 搜最新的
     *
     * @param experimentReportSearchVo
     * @return
     */
    ExperimentReportVo selectNewestVoBySearch(ExperimentReportSearchVo experimentReportSearchVo);

    /**
     * 根据搜索条件查询列表
     *
     * @param experimentReportSearchVo
     * @return
     */
    List<ExperimentReportListVo> selectExperimentReportListVoBySearch(ExperimentReportSearchVo experimentReportSearchVo);

    ExperimentReportVo selectVoById(Long id);

    /**
     * 获取最新的
     *
     * @return
     */
    ExperimentReportVo selectNewestVo();

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<ExperimentReport> 实例对象列表
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<ExperimentReport> entities);
}